<?php if(!defined('IN_PISCES')){exit('Access Denied.');}?>
<script language="javascript" src="{$this->data['baseurl']}js/jquery/jquery.js"></script>
<script language="javascript" src="{$this->data['baseurl']}js/jquery/form.js"></script>
<script language="javascript" src="{$this->data['baseurl']}js/utils.js"></script>
<script type="text/javascript">
var successFun=function(res){
if(res.code==200){
	document.location	= res.data.forward;
}else{
	//alert('出错了，请重新尝试！');
}
}
$(document).ready(function() { 
	var updateOptions	= {dataType:'json',error:doError,success:doSuccess}
    $('#form').ajaxForm(updateOptions); 
}); 
</script>
{if !empty($this->data['adList']) && !empty($this->data['adList'][14])}
<!--{loop $this->data['adList'][14] $mk $item}-->
<div class="ad-all mb5">
{$item['code']}
</div>
<!--{/loop}-->
{/if}
{if !empty($this->data['postList'])}
<!--{loop $this->data['postList'] $mk $item}-->
<div class="post">
	<div class="author">
	<img src="{if $item['user']['logo']}{$item['user']['logo']}{else}{$this->data['baseurl']}images/avatar-120.png{/if}" />
	{$item['username']}
	</div>
	{if $item['type']==1}
	<blockquote class="triangle-isosceles left">
	<div class="postinfo">
	<div class="title"><h1>{$item['title']}</h1>{if $this->data['user']['id'] && $this->data['user']['id']==$item['user_id']}&nbsp;&nbsp;<a href="{url('Post','Edit',array('id'=>$item['id']))}" class="op">[编辑]</a>{/if}</div>
	<div class="content">{$item['content']['content']}</div>
	{if !empty($item['tags'])}<div class="tag"><!--{loop $item['tags'] $tag}--><a href="{url('Post','List',array('tag'=>$tag['id']))}">{$tag['name']}</a><!--{/loop}--></div>{/if}
	</div>
	</blockquote>
	{else}
	{if $item['type']==2}
	<blockquote class="triangle-isosceles left">
	<div class="postinfo">
	<div class="title">{if $item['content']['product']['id']}<a linktype="click-url" href="#" nid="{$item['content']['product']['id']}" target="_blank">{else}<a href="{$item['content']['url']}" rel="nofollow" target="_blank">{/if}<h1>{$item['title']}</h1></a>{if $this->data['user']['id'] && $this->data['user']['id']==$item['user_id']}&nbsp;&nbsp;<a href="{url('Post','Product',array('id'=>$item['id']))}" class="op">[编辑]</a>{/if}</div>
	{if $item['content']['product']}
	{if $item['content']['product']['image']}<div class="image"><a linktype="click-url" href="#" nid="{$item['content']['product']['id']}" target="_blank"><img src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['content']['product']['image']}" onload="if(this.width>700){this.width=700;}"/></a></div>{/if}
	<div class="info">
		{if $item['content']['product']['price']}<div class="price">价格：<span>{$item['content']['product']['price']}</span></div>{/if}
		{if $item['content']['product']['seller']}<div class="seller">卖家：<span><a linktype="shop-click-url" href="#" nid="{$item['content']['product']['id']}" target="_blank">{$item['content']['product']['seller']}</a></span></div>{/if}
		<div class="content">{nl2br($item['content']['content'])}</div>
		{if !empty($item['tags'])}<div class="tag"><!--{loop $item['tags'] $tag}--><a href="{url('Post','List',array('tag'=>$tag['id']))}">{$tag['name']}</a><!--{/loop}--></div>{/if}
	</div>
	{else}
	<div class="content">{nl2br($item['content']['content'])}</div>
	{if !empty($item['tags'])}<div class="tag"><!--{loop $item['tags'] $tag}--><a href="{url('Post','List',array('tag'=>$tag['id']))}">{$tag['name']}</a><!--{/loop}--></div>{/if}
	{/if}
	</div>
	</blockquote>
	{else}
	<blockquote class="triangle-border left">
	<div class="postinfo">
	<div class="content">{nl2br($item['content']['content'])}</div>
	</div>
	</blockquote>
	{/if}
	{/if}
	{if $item['type']>0}
	{if !empty($this->data['related']['con'])}
	{ProductList(array_merge($this->data['related']['con'],array('page_no'=>1,'page_size'=>8,'keyword'=>$this->data['cf']->getRandKeyword($this->data['related']['con']['keyword']))),array('pic_url,num_iid,title'),86400,'post_view')}
	{/if}
	{if !empty($pvProductList)}
	<div class="relatedproduct">
		<div class="header">相关推荐</div>
		<div class="goods">
			<ul>
			<!--{loop $pvProductList $pk $item}-->
			<li><a linktype="click-url" href="#" nid="{$item['num_iid']}" target="_blank" class="good-img" title="{strip_tags($item['title'])}"><img alt="{strip_tags($item['title'])}" src="{$this->data['baseurl']}images/loading.gif" u="{EncodeImg $item['pic_url']}_b.{$this->data['cf']->getFileExt($item['pic_url'])}" /></a><div class="title"><a linktype="click-url" href="#" nid="{$item['num_iid']}" target="_blank" class="good-title" title="{strip_tags($item['title'])}">{strip_tags($item['title'])}</a></div></li>
			<!--{/loop}-->
			</ul>
		</div>
	</div>
	{/if}
	{/if}
</div>
<!--{/loop}-->
{/if}
{if $this->data['user']['id']}
<div class="post">
	<div class="author">
	<img src="{$this->data['user']['logo']}" />
	{$this->data['user']['username']}
	</div>
	<form id="form" action="{url('Post','SaveComment')}" method="post">
	<blockquote class="triangle-border left">
	<div class="postinfo">
	<div class="content">
		<textarea name="content#content" id="txtcontent" style="width:770px;height:100px" class="txtcomment" onclick="if(this.value=='在这里输入点评内容'){this.value='';}">在这里输入点评内容</textarea>
		<br /><span etype='error_info' class="error_info" id="content#content_info"></span>
		<input type="hidden" name="pid" value="{$this->data['postList'][0]['id']}" />
	</div>
	</div>
	</blockquote>
	<input id="btnAjaxSubmit" class="btncomment" type="submit" value="发表点评" />
	</form>
</div>
{else}
<div class="logintips">登陆后可以发表您的评论，<a href="{$this->data['loginUrl']}">点击这里立即登陆</a></div>
{/if}
<div class="pager">{$this->data['pages']}</div>
{if !empty($this->data['adList']) && !empty($this->data['adList'][15])}
<div class="clear"></div>
<!--{loop $this->data['adList'][15] $mk $item}-->
<div class="ad-all mt5">
{$item['code']}
</div>
<!--{/loop}-->
{/if}
<script language="javascript">
var defaultClickUrl	= "{$this->data['clickUrl']}";
replaceLink();
replaceImage();
</script>